package com.linln.modules.gdp.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.linln.common.enums.StatusEnum;
import com.linln.common.utils.StatusUtil;
import com.linln.component.excel.annotation.Excel;
import com.linln.component.excel.enums.ExcelType;
import com.linln.modules.system.domain.User;
import lombok.Data;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author cocia
 * @date 2021/10/10
 */
@Data
@Entity
@Table(name="or_region_gdp")
@EntityListeners(AuditingEntityListener.class)
@Where(clause = StatusUtil.NOT_DELETE)
@Excel("审核数据")
public class RegionGdp implements Serializable {
    // 主键ID
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Excel(value = "ID", type = ExcelType.EXPORT)
    private Long id;
    //公司名称
    private String city;
    //公司名称
    @Excel("公司名称")
    private String name;
    // 备注
    private String remark;
    // 申请时间
    @CreatedDate
    private Date createDate;
    // 创建时间
    @Excel("申请时间")
    private String applyDate;
    // 更新时间
    @LastModifiedDate
    private Date updateDate;
    // 创建者
    @CreatedBy
    @ManyToOne(fetch=FetchType.LAZY)
    @NotFound(action=NotFoundAction.IGNORE)
    @JoinColumn(name="create_by")
    @JsonIgnore
    private User createBy;
    // 更新者
    @LastModifiedBy
    @ManyToOne(fetch=FetchType.LAZY)
    @NotFound(action=NotFoundAction.IGNORE)
    @JoinColumn(name="update_by")
    @JsonIgnore
    private User updateBy;
    // 数据状态
    private Byte status = StatusEnum.OK.getCode();
    // 审核员
    @Excel("审核员")
    private String checkName;
    // 审核次数
    @Excel("审核次数")
    private String checkNums;
    // 申报事项
    @Excel("申报类别")
    private String applyItem;
    // 等级
    @Excel("申请级别")
    private String grade;
    // 审核状态
    @Excel("审核状态")
    private String checkStatus;
    // 是否技审
    @Excel("是否通过技审")
    private String reviewStatus;
    // 审核时间
    @Excel("审核时间")
    private String checkDate;
    // 审核时间
    @Excel("技审通过时间")
    private String reviewDate;
    // 受理时间
    @Excel("受理时间")
    private String acceptDate;
    // 公示时间
    @Excel("公示时间")
    private String publicDate;
    // 审批时间
    @Excel("审批时间")
    private String approveDate;
    // 审批时间
    @Excel("审批时间")
    private String certificate;
}